package page.Beans;

import java.sql.SQLException;

import basicTypes.RAReport;
import basicTypes.RAResource;

public class putInmaintence {
	private int idRec;

	public void setIdRec(int idRec) {
		this.idRec = idRec;
	}

	public int getIdRec() {
		return idRec;
	}
	
	public String putInMain(loginBean x) throws SQLException{
			RAResource recurso;
		try{
			recurso = x.getBd().db_getResource(x.getUser(), idRec);
		}
		catch(SQLException e){
			return "fail";
		}
		if(recurso != null){
		RAReport reporte = new RAReport(x.getUser().getId(), idRec, "");
		x.getBd().db_putInMaintenance(x.getUser(), reporte);
		
		return "suc";
		}
		return "fail";
		
	}
}
